package cn.fl.spl.transform;


import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.spl.vo.CstRelInfoViewVO;
import fl.spl.facade.view.dto.CstRelInfoViewDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * @Desc 客户相关信息视图信息 TRANSFORM
 */
public class CstRelInfoViewVOTransform {


	/**
	 * VO ת  DTO
	 * @param po CstRelInfoView
	 * @return CstRelInfoViewDTO
	 */
	public static CstRelInfoViewDTO toDTO(CstRelInfoViewVO vo) {
		CstRelInfoViewDTO  dto = null;
		if (vo != null) {
			dto = new CstRelInfoViewDTO();
			dto.setId(vo.getId());
			dto.setRelId(vo.getRelId());
			dto.setRelNm(vo.getRelNm());
			dto.setRelTypCd(vo.getRelTypCd());
			dto.setAssTypCd(vo.getAssTypCd());
			dto.setAudStsCd(vo.getAudStsCd());
			dto.setIdNum(vo.getIdNum());
			dto.setIsClick(vo.getIsClick());
			dto.setName(vo.getName());
			dto.setPropTypCd(vo.getPropTypCd());
		}
		return dto;
	}

	/**
	 * DTO ת  VO
	 * @param dto CstRelInfoViewDTO
	 * @return CstRelInfoView
	 */
	public static CstRelInfoViewVO toVO(CstRelInfoViewDTO dto) {
		CstRelInfoViewVO vo = null;
		if (dto != null) {
			vo = new CstRelInfoViewVO();
			vo.setId(dto.getId());
			vo.setRelId(dto.getRelId());
			vo.setRelNm(dto.getRelNm());
			vo.setRelTypCd(dto.getRelTypCd());
			vo.setAssTypCd(dto.getAssTypCd());
			vo.setAudStsCd(dto.getAudStsCd());
			vo.setIdNum(dto.getIdNum());
			vo.setIsClick(dto.getIsClick());
			vo.setName(dto.getName());
			vo.setPropTypCd(dto.getPropTypCd());
		}
		return vo;
	}

	/**
	 * toDTOList
	 * @param list
	 * @return
	 */
	public static List<CstRelInfoViewDTO> toDTOList(List<CstRelInfoViewVO> list) {
		List<CstRelInfoViewDTO>  dtoList = new ArrayList<CstRelInfoViewDTO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (CstRelInfoViewVO vo : list) {
				dtoList.add(toDTO(vo));
			}
		}
		return dtoList;
	}
	
	/**
	 * toVOList
	 * @param list
	 * @return
	 */
	public static List<CstRelInfoViewVO> toVOList(List<CstRelInfoViewDTO> list) {
		List<CstRelInfoViewVO>  voList = new ArrayList<CstRelInfoViewVO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (CstRelInfoViewDTO dto : list) {
				voList.add(toVO(dto));
			}
		}
		return voList;
	}
}
